﻿Imports DAO
Imports System.Data
Imports System.Data.OleDb
Imports DTO
Public Class BenhNhanDAO

    Public Function TimKiem_DAO(ByVal BN As DanhSachKhamBenh_DTO) As DataTable
        Dim DTP As New DataProvider()

        
        Dim query As String
        Dim where As String
        where = "  DSKB.MaBenhNhan = "

       

        If (BN.MaBenhNhan <> -1) Then

            where += BN.MaBenhNhan.ToString()
        End If

       
        query = " select DSKB.HoTen,DSKB.NgayKham,PKB.TrieuChung,B.TenBenh from DANHSACHKHAMBENH DSKB,PHIEUKHAMBENH PKB ,BENH B,CHITIET_PKB CT where (" + where + ") and DSKB.MaBenhNhan=PKB.MaBenhNhan and PKB.MaPhieu=CT.MaPhieu and CT.MaBenh=B.MaBenh "
        Dim DT As New DataTable()
        DT = DTP.Datatable_PHONGMACHTU(query)

        Return DT

    End Function
End Class

